package com.muse.designpatterns.command;

/**
 * 命令模式
 */
public class CommandTest {

    public static void main(String[] args) {
        RemoteController remoteController = new RemoteController();
        Light light = new Light();
        /** 初始化遥控器操作指令 */
        remoteController.addCommand(0,new LightOnCommand(light),new LightOffCommand(light));
        remoteController.pushOnButton(0);
        remoteController.pushOffButton(0);
    }
}
